package com.example.UI;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import sdstcom.lbq.one.R;


/**
 * Created by Administrator on 2017/1/9.
 */

public class Mydialog extends AlertDialog.Builder implements View.OnClickListener {

    private Context cotext;
    private String name;
    private String content;
    private LayoutInflater inflater;
    private Dialog dialog;
    public Mydialog(Context context,String name,String content) {
        super(context);
        this.cotext = context;
        this.name = name;
        this.content = content;
        inflater = LayoutInflater.from(context);
        init();
    }

    private void init() {
        View view = inflater.inflate(R.layout.dialog,null);
        TextView nametv = (TextView) view.findViewById(R.id.esscom_huifuname_tv);
        TextView contenttv = (TextView) view.findViewById(R.id.esscom_huifucontent_tv);
        Button btn = (Button) view.findViewById(R.id.comment_huifu_btn);
        EditText et = (EditText) view.findViewById(R.id.esscom_huifu_edit);
        nametv.setText(name);
        contenttv.setText(content);
        btn.setOnClickListener(this);
        setView(view);
    }

    public void showdialog(){
        dialog = create();
        dialog.show();
    }
    @Override
    public void onClick(View v) {
        dialog.dismiss();
    }
}
